#ifndef _BUOLA_GRAPH_COMPONENTS_H_
#define _BUOLA_GRAPH_COMPONENTS_H_

#include <buola/graph/cgraph.h>
#include <buola/graph/properties.h>
#include <boost/graph/connected_components.hpp>

namespace buola { namespace graph {

template<typename tGraph>
std::vector<std::vector<typename tGraph::vertex_descriptor>> connected_components(tGraph &pGraph)
{
    std::vector<std::vector<typename tGraph::vertex_descriptor>> lResult;
    auto lColor=new_vertex_property<int>(pGraph);
    boost::connected_components(pGraph,classify_map(lResult),boost::color_map(lColor.Map()));
    return lResult;
}

/*namespace graph*/ } /*namespace buola*/ }

#endif
